export function resizeWindow(key) {
  if (
    sessionStorage.getItem &&
    !sessionStorage.getItem(key)
  ) {
    sessionStorage.setItem(
      key,
      document.documentElement.clientWidth
    )
  }
  window.onresize = function (a) {
    var resizePreWidth = sessionStorage.getItem(key)
    var resizeOverWidth = a.currentTarget.innerWidth
    if (
      (resizePreWidth <= 979 && resizeOverWidth >= 980) ||
      (resizePreWidth >= 980 && resizeOverWidth <= 979)
    ) {
      document.location.reload()
      sessionStorage.setItem(key, resizeOverWidth)
    }
  }
}
// 页面重新加载的条件